package com.hospes.rmes;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;
import com.hospes.rmes.constants.ConstMain;

/**
 * Created by IntelliJ IDEA.
 * User: Andrew Khloponin
 * Date: 17.06.11
 */
public class MainActivity extends TabActivity {
	private Resources res;
	private TabHost tabHost;
	private TabHost.TabSpec tabSpec;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Log.i(ConstMain.LOG_TAG, "Start " + this.getClass().getName());
		setContentView(R.layout.view_main);

		Intent intent;
		res = getResources();
		tabHost = getTabHost();

		intent = new Intent().setClass(this, NewsActivity.class);
		tabSpec = tabHost.newTabSpec("news").setIndicator(res.getString(R.string.tab_main_news), res.getDrawable(R.drawable.ic_tab_news)).setContent(intent);
		tabHost.addTab(tabSpec);

		intent = new Intent().setClass(this, InfoActivity.class);
		tabSpec = tabHost.newTabSpec("photos").setIndicator(res.getString(R.string.tab_main_photos), res.getDrawable(R.drawable.ic_tab_photos)).setContent(intent);
		tabHost.addTab(tabSpec);

		intent = new Intent().setClass(this, InfoActivity.class);
		tabSpec = tabHost.newTabSpec("videos").setIndicator(res.getString(R.string.tab_main_videos), res.getDrawable(R.drawable.ic_tab_videos)).setContent(intent);
		tabHost.addTab(tabSpec);

		intent = new Intent().setClass(this, InfoActivity.class);
		tabSpec = tabHost.newTabSpec("more").setIndicator(res.getString(R.string.tab_main_more), res.getDrawable(R.drawable.ic_tab_more)).setContent(intent);
		tabHost.addTab(tabSpec);

		intent = new Intent().setClass(this, InfoActivity.class);
		tabSpec = tabHost.newTabSpec("info").setIndicator(res.getString(R.string.tab_main_info), res.getDrawable(R.drawable.ic_tab_info)).setContent(intent);
		tabHost.addTab(tabSpec);

		tabHost.setCurrentTab(0);
	}
}
